<script setup lang='ts'>
const props = defineProps({
    car: String,
    changeCarCb:Function
})
console.log(props.car)
const emit = defineEmits(['changeCar'])
</script>

<template>
    <div style="width:300px;height:200px;border:10px solid red">
        子组件
        <div>车：{{ car }}</div>
        <button @click="emit('changeCar', '劳斯莱斯')">换车</button>
        <button @click="changeCarCb('奔驰s600')">换车2</button>
    </div>
</template>

<style scoped></style>